package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * @description: TODO
 * @author yumo
 * @version: 1.0
 * @date 2025/3/14 17:43
 */
public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("demo.txt");
        String str="Oi——，你个小八嘎";
        byte[] data=str.getBytes(StandardCharsets.UTF_8);
        fos.write(data);
        System.out.println("写出完成");
        fos.close();
    }
}
